#!/usr/bin/env python
import sys
import os

from getopt import gnu_getopt
from parse import ParseFile
from writer import DotWriter

def get_file_list(args):
    file_list = args[1:]
    return file_list

if __name__ == '__main__':
    file_list = get_file_list(sys.argv)
    print file_list

    #TODO
    # get root from user
    parser = ParseFile(root='./')

    class_agent_list = parser.parseFile(file_list)

    #TODO
    # identify stream
    writer = DotWriter(class_agent_list)
    writer.toDot()
    # here we genearte the graph
    print 'generating...'
    os.system('cat haha.dot | dot -Tpng > res.png')
